import request from '@/utils/request'

// 获取社区团购活动
export const apiCommunityGroupPurchaseActivityList = params => request.get(
	'communityGroupPurchase/activityList', {
		params
	})

// 获取社区团购团长协议
export const apiCommunityGroupPurchaseLeaderAgreement = () => request.get(
	'communityGroupPurchase/getAgreement')

// 获取社区团购团长申请自定义字段
export const apiCommunityGroupPurchaseLeaderField = () => request.get(
	'communityGroupPurchase/getDiyApplyField')

// 提交申请
export const apiCommunityGroupPurchaseLeaderApply = params => request.post('communityGroupPurchase/apply', params)

// 获取团长参与活动
export const apiCommunityGroupPurchaseLeaderActivityList = params => request.get(
	'communityGroupPurchase/getLeaderActivityList', {
		params
	})

// 获取团购活动详情
export const apiCommunityGroupPurchaseLeaderActivityDetail = params => request.get(
	'communityGroupPurchase/getLeaderActivityDetail', {
		params
	})

// 获取团长信息
export const apiCommunityGroupPurchaseLeaderDetail = params => request.get(
	'communityGroupPurchase/getLeaderDetail', {
		params
	})

// 更新团长信息
export const apiUpdateCommunityGroupPurchaseLeaderInfo = params => request.post(
	'communityGroupPurchase/updateLeaderInfo', params)

// 获取团长活动信息
export const apiCommunityGroupPurchaseNearLeaderActivityList = params => request.get(
	'communityGroupPurchase/getNearLeaderActivityList', {
		params
	})

// 获取距离最近团长列表
export const apiCommunityGroupPurchaseNearLeaderList = params => request.get(
	'communityGroupPurchase/getNearLeaderList', {
		params
	})

// 获取距离最近团长
export const apiCommunityGroupPurchaseNearLeaderDetail = params => request.get(
	'communityGroupPurchase/getNearLeaderDetail', {
		params
	})

// 设默认团长
export const apiCommunityGroupPurchaseSetDefLeader = params => request.get(
	'communityGroupPurchase/setDefLeader', {
		params
	})

// 获取团长最新的活动
export const apiCommunityGroupPurchaseLasestLeaderActivity = params => request.get(
	'communityGroupPurchase/getLasestLeaderActivity', {
		params
	})

// 获取活动销量
export const apiCommunityGroupPurchaseActivitySaleCount = params => request.get(
	'communityGroupPurchase/getActivitySaleCount', {
		params
	})


// 获取购物车列表
export const apiCommunityGroupPurchaseCartLists = params => request.get('communityGroupPurchase/cartlists', {
	params
})

// 购物车添加商品
export const apiCommunityGroupPurchaseCartAdd = params => request.post('communityGroupPurchase/cartadd', params)

// 删除购物车商品
export const apiCommunityGroupPurchaseCartDel = params => request.post('communityGroupPurchase/cartdel', params)

// 清空购物车商品
export const apiCommunityGroupPurchaseCartClear = params => request.post('communityGroupPurchase/cartclear', params)

// 购物车中商品数量的修改
export const apiCommunityGroupPurchaseCartCountChange = params => request.post(
	'communityGroupPurchase/cartChange',
	params)

/** S 订单 **/
// 结算订单 | 提交订单
export const apiCommunityGroupPurchaseOrderPlace = params => request.post('communityGroupPurchase/placeOrder', params)

// 订单列表
export const apiCommunityGroupPurchaseOrderList = params => request.get('communityGroupPurchase/orderLists', {
	params
})

// 订单详情
export const apiCommunityGroupPurchaseOrderDetail = params => request.get('communityGroupPurchase/orderDetail', {
	params
})

// 取消订单
export const apiCommunityGroupPurchaseOrderClose = params => request.post('communityGroupPurchase/orderCancel', params)

// 团长订单列表
export const apiCommunityGroupPurchaseLeaderOrderList = params => request.get(
	'communityGroupPurchase/orderLeaderLists', {
		params
	})

// 团长订单详情
export const apiCommunityGroupPurchaseLeaderOrderDetail = params => request.get(
	'communityGroupPurchase/orderLeaderDetail', {
		params
	})


export const apiCommunityGroupPurchaseLeaderVerification = params => request.post(
	'communityGroupPurchase/leaderVerification', params)
/** E 订单 **/
